#include "gui/objects/hud/GUISpeedometerHand.h"

namespace gui {

GUISpeedometerHand::GUISpeedometerHand(CarController* carController) {
	this->setTexture("res/img/speedometer-hand.bmp", 0, 0, 0, false);
	this->setSizeInMeters(0.0, 0.0);
	double handAngleOffset = 5 * PI / 4;
	double totalAngleRange = 6 * PI / 4;
	double handAngle = handAngleOffset + carController->getCarSpeed() * totalAngleRange / carController->getMaxCarSpeed();
	this->setRotation(handAngle);
	// TODO parametrizar.
	this->setPosition(75, 465);
}

GUISpeedometerHand::~GUISpeedometerHand() {

}

}
